package singleton.lazy;
/**
 * 双重校验锁
 * 优点：线程安全且在多线程下能保持高性能
 * @author lenovo
 *
 */
public class LazyDoubleCheckSingleton {
	private static LazyDoubleCheckSingleton lazySingleton=null;
	private LazyDoubleCheckSingleton() {
		
	}
	public static LazyDoubleCheckSingleton getInstance() {
		if (lazySingleton==null) {
			synchronized (LazyDoubleCheckSingleton.class) {
				if (lazySingleton==null) {
					lazySingleton=new LazyDoubleCheckSingleton();
				}
			}
		}
		return lazySingleton; 
	}
}
